<?php
  //header("Content-Type: text/html; charset=ISO-8859-1",true);
  
?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  <title>Cadastro</title>
  <link href="css/cadastro.css" rel="stylesheet" type="text/css" />
  
  
  
  <script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
  <style type="text/css">
  #apDiv5 {
	position:absolute;
	left:10%;
	top:-2px;
	width:41px;
	height:881px;
	z-index:3;
	background-image: url(img/4.png);
	background-repeat: repeat-y;
}
  #apDiv6 {
	position:absolute;
	left:86%;
	top:-2px;
	width:41px;
	height:881px;
	z-index:4;
	background-image: url(img/4.png);
	background-repeat: repeat-y;
}
  #apDiv8 {
	position:absolute;
	left:50px;
	top:656px;
	width:36px;
	height:15px;
	z-index:5;
	font-family: Verdana, Geneva, sans-serif;
	font-size: 10px;
	text-decoration: none;
	cursor: pointer;
}
  </style>
  </head>
  <body>
  <div id="apDiv5"></div>
  <div id="apDiv6"></div>
  
  <script type="text/javascript">
  $(
  function(){
  $("#mainForm").bind("submit", validar);
  }
  );
  
  /**
  * Executa a verifica��o
  */
  function validar(e){
  // determina se o form pode ser submetido ou n�o
  var canSubmit = true;
  
  // acumula as mensagens de erro
  var messages = "<ul>";
  
  
  // faz uma busca por todos elementos que especificam o atributo req=true
  $("[req=true]").each(
  function(){
  if($(this).val().length < 1){
  canSubmit = false;
  messages += "<li>" + $(this).attr("label") + "</li>";
  }else if(!$("input[name=contrato]:checked").val()){
  canSubmit = false;
  alert ('Voc� precisa aceitar o contrato');
  }
  }
  );
  
  messages += "</ul>";
  
  // verifica se vai exibir as mensagens de erro
  if(canSubmit == false)
  $("#divError").html(messages).css("color", "red").fadeIn(300);
  return canSubmit;
  }	

</script>
  
  <div id="apDiv1">
  <div id="apDiv8"><span id="link" onclick="window.location='index.php'" style="cursor:pointer">Login</span></div>
  <div id="apDiv4">
      <form id="mainForm" name="mainForm" method="post" action="../classesC/JogadorC.php" >
      <input type="hidden" name="cad" value="cad" />  
  <div id="divError" style="display: none; font-size: 11px"></div>
  <p>Nome:<br />
  <label for="nome"></label> <input type="text" name="nome" id="nome"
	  label="Campo Nome vazio" size="45" req="true" /><br />
  
  </p>
  <p>E-mail (email v&aacute;lido pra confirma��o):<br />
  <label for="email"></label> <input type="text" name="email" id="email"
	  size="45" label="Campo E-mail vazio" req="true" /><br />
  
  </p>
  <p>Repetir E-mail<br />
  <label for="email1"></label> <input type="text" name="email1"
	  id="email1" size="45" label="Repetir E-mail vazio ou n�o confere"
	  req="true" /><br />
  
  </p>
  <p>Sexo:<br />
  <label for="sexo"></label> <select name="sexo" id="sexo">
	  <option>Masculino</option>
	  <option>Feminino</option>
  </select> <label for="dataDeNascimento"></label></p>
  <p>Senha:<br />
  <label for="senha"></label> <input type="password" name="senha"
	  id="senha" label="Campo Senha vazio" req="true" /><br />
  
  </p>
  <p>Repetir Senha:<br />
  <label for="senha1"></label> <input type="password" name="senha1"
	  id="senha1" label="Repetir Senha vazia ou nao confere" req="true" /><br />
  
  </p>
  <p><input name="contrato" type="checkbox" id="contrato"
	  checked="checked" label="Aceite os termos" req="true" /> Li e aceito
  contrato de lincen&ccedil;a <label for="contrato"></label></p>
  <p>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type="submit" name="button" id="button"
	  value="CADASTRAR MINHA CONTA" /></p>
  </form>
  </div>
  </div>
  <div id="apDiv2"></div>
  </body>
  </html>
